package com.tinyseed.emcp.api.basicdata.rest;

import com.tinyseed.emcp.api.basicdata.service.WorkshopService;
import com.tinyseed.hmxx.common.base.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/workshop")
public class WorkshopController extends BaseController {

    private final WorkshopService workshopService;

    public WorkshopController(WorkshopService workshopService) {
        this.workshopService = workshopService;
    }

    @PostMapping(value = "/getListByEnterpriseId")
    @ResponseBody
    public ResponseEntity getListByEnterpriseId(Long enterpriseId) {
        return new ResponseEntity<>(workshopService.getListByEnterpriseId(enterpriseId), HttpStatus.OK);

    }
}
